#!/bin/sh
v=`grep '"version":' trunk/era/manifest.json | perl -pe 's/.*"(\d+\.\d+\.\d+.*)"/\1/; s/\n//;'`
d=`date +%Y-%m-%d`
echo Version:$v, Date: $d
targetDir=tags/v$v
cp -r trunk/era $targetDir
find $targetDir -name .svn | xargs rm -rf
sed "s|trunk/era|$targetDir|; s|.*@version.*|// @version		$v|; s|var VERSION_DATE = '.*'.*|var VERSION_DATE = '$d';|; s|var VERSION_STR = '.*'.*|var VERSION_STR = 'v$v'|" < trunk/era/nng_helper.user.js > $targetDir/nng_helper.user.js
